﻿<UserControl x:Class="SGGWElevator.FloorButtonsPanel"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             Height="40" Width="200">
    <UserControl.Resources>
        <SolidColorBrush x:Key="DefaultBackground" Color="#2d2d30"/>
        <SolidColorBrush x:Key="DefaultForeground" Color="#686868"/>
        <SolidColorBrush x:Key="ActiveForeground" Color="#007acc"/>
        <SolidColorBrush x:Key="HoverBorderColor" Color="#3e3e42"/>

        <Style TargetType="{x:Type Button}">
            <Setter Property="Button.FontFamily" Value="/Fonts/#Segoe WP"/>
            <Setter Property="FontSize" Value="24"/>
            <Setter Property="Background" Value="{StaticResource DefaultBackground}"/>
            <Setter Property="Foreground" Value="{StaticResource DefaultForeground}"/>
            <Setter Property="Height" Value="40"/>
            <Setter Property="Width" Value="40" />
            <Setter Property="BorderThickness" Value="0"/>

            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Button}">
                        <Grid 
                            Width="{TemplateBinding Width}"
                            Height="{TemplateBinding Height}"
                            ClipToBounds="True">
                            <Rectangle
                                x:Name="ControlBorder"
                                HorizontalAlignment="Stretch"
                                VerticalAlignment="Stretch"
                                Fill="{StaticResource DefaultBackground}"
                                Stroke="{StaticResource DefaultBackground}"
                                StrokeThickness="3"/>
                            <DockPanel x:Name="ContentHolder">
                                <ContentPresenter
                                    VerticalAlignment="Center"
                                    HorizontalAlignment="Center"
                                    x:Name="ContentPresenter"                                    
                                    Content="{TemplateBinding Content}" />
                            </DockPanel>
                        </Grid>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="Rectangle.Stroke" TargetName="ControlBorder" 
      Value="{StaticResource HoverBorderColor}" />
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>                
            </Setter>
        </Style>
    </UserControl.Resources>

    <WrapPanel x:Name="rootPanel" ItemWidth="40">
        <Button x:Name="MinusOneFloorButton" Click="OnButtonClick" Content="-1"/>
        <Button x:Name="LobbyButton" Click="OnButtonClick" Content="0"/>
        <Button x:Name="FirstFloorButton" Click="OnButtonClick" Content="1"/>
        <Button x:Name="SecondFloorButton" Click="OnButtonClick" Content="2"/>
        <Button x:Name="ThirdFloorButton" Click="OnButtonClick" Content="3"/>
    </WrapPanel>
</UserControl>
